/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.letmeshare.stockkeeper.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author gAmE wOrLd
 */
public class DateUtil {
    private static SimpleDateFormat DDMMYYYY = new SimpleDateFormat("ddMMyyyy");
    private static SimpleDateFormat DDMMYYYYHHMMSS = new SimpleDateFormat("ddMMyyyyHHmmss");
    
    public static Date beginning(Date date) throws ParseException {
        return DDMMYYYYHHMMSS.parse(DDMMYYYY.format(date)+"000000");
    }
    
    public static Date end(Date date) throws ParseException {
        return DDMMYYYYHHMMSS.parse(DDMMYYYY.format(date)+"235959");
    }
}
